﻿<UserControl x:Class="Poet.SearchSettingsControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Avalon="clr-namespace:Poet" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    
    <UserControl.Resources>

    	<ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type System:Enum}"
                            x:Key="SearchItems">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="Avalon:SearchItems"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

        <Avalon:FindAndRepaceManager x:Key="SearchAndReplaceManager" SearchItems="CurrentDocument"/>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Label Content="Look in:" Grid.Row="0" Margin="7,0" />
        <ComboBox  TabIndex="0"  Grid.Row="1" Margin="7,0"
                                   ItemsSource="{Binding Source={StaticResource SearchItems}}"
                                   SelectedItem="{Binding Source={StaticResource SearchAndReplaceManager}, Path=SearchItems}"/>

        <GroupBox Grid.Row="3" Header="_Options"  Name="groupBox1" Margin="0,14">

            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <CheckBox Content="Match _case" Grid.Row="4" Focusable="True" Margin="5" Name="_matchCase" 
                                  IsChecked="{Binding Source={StaticResource SearchAndReplaceManager}, Path=MatchCase}"/>
                <CheckBox Content="Match _whole word" Grid.Row="5" Focusable="True" Margin="5" Name="_matchWholeWord" 
                                  IsChecked="{Binding Source={StaticResource SearchAndReplaceManager}, Path=MatchWholeWord}"/>
                <CheckBox Content="Search _up" Grid.Row="6" Focusable="True" Margin="5" Name="_searchUp" 
                                  IsChecked="{Binding Source={StaticResource SearchAndReplaceManager}, Path=SearchUp}"/>
                <CheckBox Content="Use _regular expression" Grid.Row="7" Focusable="True" Margin="5" Name="_useRegularExpression" 
                                  IsChecked="{Binding Source={StaticResource SearchAndReplaceManager}, Path=UseRegularExpression}"/>
            </Grid>

        </GroupBox>
    </Grid>
    
</UserControl>
